package com.longrise.android;

import android.app.Application;
import android.content.Context;

import com.longrise.LEAP.Base.Objects.EntityBean;

/**
 * Created by chengsan on 17/6/19.
 */

public class BaseApplication extends Application
{
    private static BaseApplication baseApplication;
    //用户Session过期标志符数组
    private String[] sessionTimeOutArray;
    //用户被挤掉标志符数组
    private String[] loginOutArray;
    //登录数据集合
    private EntityBean loginInfoBean;
    //设置restate的Key
    private String restateKey = "restate";
    //没有网络时，内部是否提示，默认不提示
    private boolean showNetNotice = false;

    @Override
    public void onCreate()
    {
        super.onCreate();
        baseApplication = this;
    }

    /**
     * 设置session超时数组
     * @param sessionTimeOutArray
     */
    public void setSessionTimeOutArray(String[] sessionTimeOutArray) {
        this.sessionTimeOutArray = sessionTimeOutArray;
    }

    /**
     * 设置用户被挤掉数组
     * @param loginOutArray
     */
    public void setLoginOutArray(String[] loginOutArray) {
        this.loginOutArray = loginOutArray;
    }

    /**
     * 设置登录参数
     * @param loginInfoBean
     */
    public void setLoginInfoBean(EntityBean loginInfoBean) {
        this.loginInfoBean = loginInfoBean;
    }

    /**
     * 设置restate的Key
     * @param restateKey
     */
    public void setRestateKey(String restateKey) {
        this.restateKey = restateKey;
    }


    public String getRestateKey() {
        return restateKey;
    }

    /**
     * 没有网络时，内部是否提示，默认不提示
     * @param showNetNotice
     */
    public void setShowNetNotice(boolean showNetNotice) {
        this.showNetNotice = showNetNotice;
    }

    public String[] getSessionTimeOutArray() {
        return sessionTimeOutArray;
    }

    public String[] getLoginOutArray() {
        return loginOutArray;
    }

    public EntityBean getLoginInfoBean() {
        return loginInfoBean;
    }

    public boolean isShowNetNotice() {
        return showNetNotice;
    }

    public static Context getAppContext()
    {
        return baseApplication;
    }

    public static BaseApplication getBaseApplication()
    {
        return baseApplication;
    }
}
